// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vuex from "vuex"
import infiniteScroll from "vue-infinite-scroll"
import vueLazyload from 'vue-lazyload'//图片懒加载
import $ from "jquery"
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.js'

Vue.config.productionTip = false;
Vue.use(vueLazyload, {
  loading: "/static/loading-svg/loading.gif"
});

Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    nickName: '',
    cartCount: 0,
  },
  mutations: {
    updateUserInfo: function (state, nickName) {
      state.nickName = nickName
    },
    updateCartCount: function (state, cartCount) {
      state.cartCount += cartCount
    },
    initCartCount(state, cartCount){
      state.cartCount = cartCount
    },
  }
})
//分页加载
Vue.use(infiniteScroll)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: {App},
  template: '<App/>'
})
